<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文档上传</title>

<link rel="stylesheet" href="/css/theme/App.css" type="text/css" />
<link rel="stylesheet" href="/javascript/theme/libs/jquery-easyui-1.4/themes/gray/easyui.css" type="text/css" />	

<script src="/javascript/theme/libs/jquery-1.9.1.min.js"></script>
<script src="/javascript/theme/libs/jquery-easyui-1.4/jquery.easyui.min.js"></script>
<script src="/javascript/theme/libs/bootstrap.min.js"></script>
<script type="text/javascript" src="/javascript/ajaxfileupload.js"></script>
<script src="/javascript/theme/App.js"></script>
<style type="text/css">

.sj_tl_3 {
	line-height:33px;
	border-right:1px solid #e3e6eb;
	border-bottom:1px solid #e3e6eb;
}
.sj_tl_3 th {
	font-size:14px;
	font-weight:normal;
	border-left:1px solid #e3e6eb;
	border-top:1px solid #e3e6eb;
	background:#ebebeb;
}
.sj_tl_3 td {
	border-left:1px solid #e3e6eb;
	border-top:1px solid #e3e6eb;
	padding-right:5px;
}
</style>
<script type="text/javascript">
$(function(){
	$("#fileCate1").combobox({
		selectOnNavigation: true,
		onSelect: function(newVal,oldVal){
			var cate1 = $("#fileCate1").combobox('getValue');
			var url ="/uploadDoc/getAllFileCate2?fileCate1="+cate1;
			$("#fileCate2").combobox('reload',url);
		}
	});
    $("#fileCate1").combobox('setValue','');
});	

function checkParam(){
	if($("#pdf_srcFile").val() == ''){
		alert('请选择文件！');
		return false;
	}
	var cate1 = $("#fileCate1").combobox('getText');
	var cate2 = $("#fileCate2").combobox('getText');
	if(cate1 !='' && cate2 != ''){
		$("#fileCate1").combobox('setValue',cate1);
		$("#fileCate2").combobox('setValue',cate2);
		return true;
	}else{
		alert("文件类别不得为空！");
		return false;
	}
	
}

$(function() {
	var msg = $("#message").val();
	if (msg == "success") {
		alert("上传成功！");
	} else if (msg == "error") {
		alert("上传失败!");
	} else if(msg != ""){
		alert(msg);
	}
});
</script>
</head>
<body>
<div id="content" style="OVERFLOW-X:yes;OVERFLOW-Y:auto;min-height:800px">
	<div id="content-container">
		<div class="portlet">
				<div class="portlet-header">
					<h3>
						<i class="fa fa-tasks"></i>
						数据文档上传
					</h3>
			
				</div> <!-- /.portlet-header -->

				<div class="portlet-content">
					<form onsubmit="return checkParam();" id="uploadform" name="uploadform" action="/uploadDoc/upload" method="post" ENCTYPE="multipart/form-data">
						<input type="hidden" id="message" name="message" value="$!{message}" />
						<div align="center">
      						<table  class="sj_tl_3"  width="80%" border="0" cellspacing="0" cellpadding="0">
								<tr align="center" >
          							<th style="text-align:center ; font-family:Microsoft YaHei; font-size:14px" colspan="2">
          							<span style="color:red">
										提示： 1.如上传后的文件展示效果不好，则请将文件在本地转成 <b>PDF</b> 格式后再上传。  
										</BR>
										2.支持批量上传，请将文件打包为<b>ZIP</b>格式的压缩包上传。
									</span>
		  							</th>
								</tr>
								<tr>
									<td align="center" >选择文档</td>
									<td align="center" >
										<input type="file"  name="pdf_srcFile" id="pdf_srcFile"  onchange="uploadDatas('pdf_srcFile')" value=""/> 
									</td>
								</tr>
								<tr height="30px">
									<td align="center" >文档分类</td>
									<td align="left" >
										&nbsp;&nbsp;&nbsp;&nbsp;
										类别一:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										<select id="fileCate1" name="fileCate1" value="$!fileCate1" style="width:180px;">
											#foreach( $cate1 in $cate1List)
												<option value="$!{cate1}" >$!{cate1}</option>
											#end
										 </select>
										 &nbsp;&nbsp;&nbsp;&nbsp;
										类别二:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										<select class="easyui-combobox" id="fileCate2" name="fileCate2" value="$!fileCate2" data-options="valueField: 'value',textField: 'value'" style="width:180px;">
											#foreach( $cate2 in $cate2List)
												<option value="$!{cate2}" >$!{cate2}</option>
											#end
										</select>
									</td>
								</tr>
								<tr height="40px">
									<td align="center" >文件描述</td>
									<td align="left" >
								<textarea style="font-family:'Microsoft YaHei'; font-size:14px; line-height:20px; height:140px; width:100%" name="fileDescribe" id="fileDescribe"></textarea>
									</td>
								</tr>
		
	 						</table>
	  						<table class="sj_tl_3"  width="80%" border="0" cellspacing="0" cellpadding="0">
	 							<tr>
          						<th style="text-align:center; height:35px" colspan="2" >
            					<input style="height:30px; width:50px; " type="submit"  id="saveDocInfo" name="saveDocInfo"  value="上传"/>
								&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;
								<input style="height:30px; width:50px; " type="reset"  id="saveDocInfo" name="saveDocInfo"  value="重置"/>
								&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;	&nbsp;
		  						</th>
								</tr>
      						</table>
   					 	</div>
				 	</form>
				</div> <!-- /.portlet-content -->

		</div> <!-- /.portlet -->	
		
	</div> <!-- /.content-container-->
</div> <!-- #content -->
</body>
</html>
